<?php
session_start();
require_once("../include/db.php");
include "../include/head.php";
?>
<table width="100%">
    <tr>
    	<td width="15%" valign="top">
    	  <p>
    	  <?php
    	  echo "Welcome,".$_SESSION["name"];
    	  ?>
    	  </p>    	
          Company option
          <UL>
           <li><a href="mailinglist.php">mailing list</a></li>
          </UL>    		
   	  </td>
   	  <td>
   	  	 <table width="100%">
   	  	 	<tr>
   	  	 		<td><b>Name</b>
   	  	 		</td>
   	  	 		<td><b>From Email</b>
   	  	 		</td>
   	  	 		<td><b>introduction</b>
   	  	 		</td>
   	  	 	</tr>
   	  	 	<?php
   	  	 	$sql="select * from mailing where companyid='".$_SESSION["companyid"]."'";
   	  	 	$conn=getconnection();
   	  	 	$result=mysql_query($sql,$conn);
   	  	 	while   ($row=mysql_fetch_array($result))
   	  	 	{
   	  	 		echo "<tr>";
   	  	 		echo "<td>".$row['name']."</td>";
   	  	 		echo "<td>".$row['fromemail']."</td>";
   	  	 		echo "<td>".$row['introduction']."</td>";
   	  	 		echo "</tr>";
   	  	 	}
   	  	 	mysql_close($conn);
   	  	 	?>
   	  	 </table>
   	     <form id="form1" name="form1" method="post" action="result.php">
   	       <input type="button" name="Submit" value="Add mailing list" onclick="window.open('addmailinglist.php',null,'width=470,height=240')"/>
      </form>   	     <p>&nbsp;</p></td>
   	</tr>
</table>
<?php
include "../include/foot.php";
?>
